package com.to_door_recycle.admin_web.controller;

import com.to_door_recycle.common.annotation.ApiLog;
import com.to_door_recycle.common.rest.Response;
import com.to_door_recycle.model.dto.AuthDto;
import com.to_door_recycle.admin_web.service.IAdminAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "认证模块")
@RestController
@RequestMapping("/admin/auth")
public class AdminAuthController {

    @Resource
    private IAdminAuthService authService;


    @ApiOperation("登录接口")
    @ApiLog(description = "登录接口")
    @PostMapping("/login")
    public Response<String> login(@RequestBody AuthDto authDto) {

        return null;
    }

    @ApiOperation("注册接口")
    @ApiLog(description = "注册接口")
    @PostMapping("/register")
    public Response<String> register(@RequestBody AuthDto authDto) {
        String token = authService.register(authDto);
        return Response.success(token);
    }
}
